const electron = require('electron');
const {app, ipcMain,BrowserWindow} = electron;


class IpcMain{
    constructor(mainWindow){
    	this.mainWindow = mainWindow;
    	this.init();
    }

    init() {
    	// 关闭窗口
		ipcMain.on('close-window', function(event, arg) {
			// app.quit();
			console.log(event.destroy());
		});    	
		// 最小化窗口
		ipcMain.on('small-window', function(event, arg) {
			app.hide();
		}); 		
		let mainWindow = this.mainWindow;
		// 跳转页面
		ipcMain.on('notify-window', function(event, arg) {
			// mainWindow.webContents.loadURL('http://www.baidu.com');
		});
    }
}

module.exports = IpcMain;